﻿using Avalonia.Data.Converters;
using Avalonia.Markup.Xaml;
using System;

namespace AvalonAdmin.Converters
{
    /// <summary>
    /// bool类型转换器
    /// </summary>
    public class RuleMappingTypeToTextConverter : MarkupExtension, IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is int intValue)
            {
                switch (intValue)
                {
                    case 0:return "普通车型型型"; break;
                    case 1: return "销售车型型型"; break;
                    case 2: return "精准车型"; break;
                }
            }
            return "Unknown";
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return this;
        }
    }
}


